﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NoteHelper.BaseControl
{
    public class Helper4DateTimePicker : IControlHelper
    {
        public object GetValue(Control control)
        {
            var dtp = (DateTimePicker)control;
            return dtp.Value;
        }

        public void SetValue(Control control, object value)
        {
            var dtp = (DateTimePicker)control;
            if (value == null) {
                dtp.Text = "";
                return;
            }
            dtp.Value = (DateTime)value;
        }
    }
}
